package com.feign.comsumer.feigncomsumer.controller;

import com.feign.comsumer.feigncomsumer.pojo.User;
import com.feign.comsumer.feigncomsumer.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: ConsumerController
 * @Description: TODO
 * @Author WN
 * @Date 2021/7/16 11:03
 * @Version V1.0
 */
@RestController
public class ConsumerController {
    @Autowired
    HelloService helloService;
    @RequestMapping("/feign-consumer")
    public String helloConsumber(){
        String hello = helloService.hello();
        return hello;
    }

    @RequestMapping("/feign-consumer2")
    public String hello(){
        StringBuffer st=new StringBuffer();
        st.append(helloService.hello("wn")+"  ");
        st.append(helloService.hello()+"  ");
        st.append(helloService.hello(new User("wn",22)));

        return st.toString();
    }
}
